Skip to content

chore(env): rename KOBO_SUPPORT_EMAIL to CONSTANCE_SUPPORT_EMAIL DEV-1976#279

Merged
noliveleger merged 1 commit into
masterfrom
dev-1976-constance-support-email
Jul 15, 2026
Merged

chore(env): rename KOBO_SUPPORT_EMAIL to CONSTANCE_SUPPORT_EMAIL DEV-1976#279
noliveleger merged 1 commit into
masterfrom
dev-1976-constance-support-email

Conversation

@platreth

@platreth platreth commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

🔗 Related PRs

Part of a 3-repo Constance env-var standardization:

kpi keeps backward compatibility (old names still read, with a DeprecationWarning), so this can land independently — it simply migrates the template to the new name.

Description

Renames the generated env var KOBO_SUPPORT_EMAILCONSTANCE_SUPPORT_EMAIL in the django env template.

Only the LHS var name changes; the ${DEFAULT_FROM_EMAIL} value source is unchanged.

…1976

Match the Constance env-var standardization in kpi (CONSTANCE_ prefix).
Paired with kobotoolbox/kpi#7230 — must ship together.
@greptile-apps

greptile-apps Bot commented Jul 9, 2026

Copy link
Copy Markdown

Greptile Summary

This PR renames the KOBO_SUPPORT_EMAIL environment variable to CONSTANCE_SUPPORT_EMAIL in the Django env template, as part of a coordinated 3-repo Constance env-var standardization. The value source (${DEFAULT_FROM_EMAIL}) is unchanged.

  • The rename is a single-line change in templates/kobo-env/envfiles/django.txt.tpl; no other files in this repo reference the old variable name.
  • The PR description explicitly flags that this must be merged atomically with kpi#7230 and kobo-docker#373 — without those, the support email silently reverts to its default.

Confidence Score: 5/5

Safe to merge alongside the companion kpi#7230 and kobo-docker#373 PRs; the rename is complete and no stale references remain in this repo.

The change is a single-line env var rename in a template file, the value source is unchanged, no other files in this repo reference the old name, and the PR description clearly documents the cross-repo merge requirement.

No files require special attention.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["kobo-install: django.txt.tpl\nCONSTANCE_SUPPORT_EMAIL=${DEFAULT_FROM_EMAIL}"] --> B["Generated Django .env file"]
    B --> C["kpi (Django app)\nreads CONSTANCE_SUPPORT_EMAIL"]
    D["kobo-docker: .env defaults\nCONSTANCE_SUPPORT_EMAIL=..."] --> B

    style A fill:#d4edda,stroke:#28a745
    style D fill:#d4edda,stroke:#28a745
    style C fill:#d4edda,stroke:#28a745
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["kobo-install: django.txt.tpl\nCONSTANCE_SUPPORT_EMAIL=${DEFAULT_FROM_EMAIL}"] --> B["Generated Django .env file"]
    B --> C["kpi (Django app)\nreads CONSTANCE_SUPPORT_EMAIL"]
    D["kobo-docker: .env defaults\nCONSTANCE_SUPPORT_EMAIL=..."] --> B

    style A fill:#d4edda,stroke:#28a745
    style D fill:#d4edda,stroke:#28a745
    style C fill:#d4edda,stroke:#28a745
Loading

Reviews (1): Last reviewed commit: "chore(env): rename KOBO_SUPPORT_EMAIL to..." | Re-trigger Greptile

@noliveleger noliveleger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but do not merge it.
We will to merge it when KPI changes are going to be released.

platreth added a commit to kobotoolbox/kpi that referenced this pull request Jul 15, 2026
… prefix DEV-1976 (#7230)

### 🔗 Related PRs
Part of a 3-repo Constance env-var standardization:
- **kobotoolbox/kobo-install#279** — same rename in the kobo-install env
template
- **kobotoolbox/kobo-docker#373** — same rename in the kobo-docker
default env file

Backward compatibility is preserved (see below), so these can land
independently — the deploy-repo PRs simply complete the migration to the
new names.

### 📣 Summary
Standardize all Constance override env vars on a single `CONSTANCE_`
prefix.

### 📖 Description
The env vars that override Constance defaults used three conventions
(bare, `KOBO_`, `CONSTANCE_`). This unifies them on `CONSTANCE_`,
matching the existing `CONSTANCE_ASR_MT_GOOGLE_*` precedent.

Renamed:
- `KOBO_SUPPORT_EMAIL` → `CONSTANCE_SUPPORT_EMAIL`
- `KOBO_SUPPORT_URL` → `CONSTANCE_SUPPORT_URL`
- `KOBO_ACADEMY_URL` → `CONSTANCE_ACADEMY_URL`
- `KOBO_COMMUNITY_URL` → `CONSTANCE_COMMUNITY_URL`
- `USAGE_LIMIT_ENFORCEMENT` → `CONSTANCE_USAGE_LIMIT_ENFORCEMENT` (env
fallback in `base.py` + pytest `env` in `pyproject.toml`)

**Backward compatible:** each override reads the new
`CONSTANCE_`-prefixed variable and falls back to the deprecated name
(`KOBO_*` / bare) when it's unset, emitting a `DeprecationWarning` so
deployments know to migrate. Old env vars keep working — no hard break.

The fallback logic lives in a new `constance_env` helper in
`kobo/settings/utils.py`, moved out of `base.py` along with
`dj_stripe_request_callback_method`.

### ✅ Test plan
- [x] `test_api_environment.py` — both settings axes
- [x] usage-limit-enforcement tests (KPI submissions, OpenRosa,
subsequences)
- [x] deprecated env var still read + `DeprecationWarning` fired
@noliveleger
noliveleger merged commit 55b5ac6 into master Jul 15, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants